﻿using Sys.Common;
using Sys.Core.Gen;
using Sys.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Content : System.Web.UI.Page
{
    public GenContent model { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string tag = Request.QueryString["tag"];

            if (!string.IsNullOrEmpty(tag))
            {
                model = ContentBll.I.SortEntities.FirstOrDefault(m => m.Tag.Equals(tag) && m.IsVisible);

                if (model != null)
                {
                    Home mas = Master as Home;

                    string des = StringHelper.NoHTML(model.Content);

                    mas.SetHead(model.Name, model.Name, StringHelper.CutString(des, 100));
                }
                else { model = new GenContent(); }

            }
            else { model = new GenContent(); }
        }
    }
}